package com.beesphere.excel.writer.style.resolvers;

import java.lang.reflect.Method;

import org.apache.poi.ss.usermodel.IndexedColors;

import com.beesphere.excel.writer.impls.WorkbookContext;

public class ColorResolver extends MethodBasedStyleResolver {

	private static final long serialVersionUID = 1481698918294061508L;

	public ColorResolver (Method method) {
		super (method);
	}
	
	@Override
	protected Object getValue (WorkbookContext workbookContext, Object applyTo, Object value) {
		return IndexedColors.valueOf (((String)value).toUpperCase()).getIndex ();
	}

}